home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: RE>How to embed a part into yourself
- Sent: 6/14/96 12:01 PM
- Received: 6/14/96 12:11 PM
- From: Damon Cokenias, cokenias@mtn-palace.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Rob, I just want to make sure you're doing the right thing here. I see the
- potential for a couple of problems.
-
- > ODPart* odEmbeddedPart;
- > ...
- > odEmbeddedPart->Release(ev);
-
- It is important that you use the ODF acquisition objects for this sort of
- thing. If an exception is thrown, your code will never call
- odEmbeddedPart->Release(). Your
- code should be written like this:
-
- {
- FW_CAcquiredODPart odEmbeddedPart = su->GetDraft(ev)->CreatePart(...)
-
- ...
- }
-
- When the FW_CAcquiredODPart object goes out of scope (either when the
- function returns or when an exception is thrown) the ODPart will be
- released correctly. ODF has many such acquisition objects
- (FW_CAcquiredODShape, for instance). Use them exclusively when dealing
- with refCounted objects that you only hold on to for a short period of
- time. You do the correct thing in your code when you use the
- FW_CAcquiredODShape.
-
-
- > odEmbeddedPart->Externalize(ev);
-
- As far as I can tell, this is not necessary. Once the part is embedded,
- OpenDoc will ensure that it gets externalized. Manually externalizing will
- simply slow the embed process.
-
- Finally (and I am sure you know this) your override of
- SingleEmbeddedFrameInternalized needs to do the right thing to actually
- embed the part. (I only mention this because it may not be obvious to
- other people reading this post). Your override must create an FW_MProxy
- object and call the presentation's Embed method. For more information on
- this, please see my previous posting.
-
- Otherwise, looks good!
-
- -Damon
- Quality ODF Guy
-
-
- +-----------------------------------------------------------------------+
- | /\ Damon Cokenias |
- | /^^\ cokenias@mtn-palace.com |
- | /____\ Visit the Mountain Palace at http://www.netgate.net/~cokenias |
- +-----------------------------------------------------------------------+
-
-